home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / ShutDown.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  2.5 KB  |  108 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ShutDown.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __SHUTDOWN__
  18. #define __SHUTDOWN__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifndef __MIXEDMODE__
  27. #include <MixedMode.h>
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if GENERATINGPOWERPC
  35. #pragma options align=mac68k
  36. #endif
  37.  
  38. #ifdef __CFM68K__
  39. #pragma lib_export on
  40. #endif
  41.  
  42.  
  43. enum {
  44.     sdOnPowerOff                = 1,                            /*call procedure before power off.*/
  45.     sdOnRestart                    = 2,                            /*call procedure before restart.*/
  46.     sdOnUnmount                    = 4,                            /*call procedure before unmounting.*/
  47.     sdOnDrivers                    = 8,                            /*call procedure before closing drivers.*/
  48.     sdRestartOrPower            = 3                                /*call before either power off or restart.*/
  49. };
  50.  
  51. /*
  52.         ShutDwnProcPtr uses register based parameters on the 68k and cannot
  53.         be written in or called from a high-level language without the help of
  54.         mixed mode or assembly glue.
  55.  
  56.         In:
  57.          => shutDownStage    D0.W
  58. */
  59.  
  60. #if GENERATINGCFM
  61. typedef UniversalProcPtr ShutDwnUPP;
  62. #else
  63. typedef Register68kProcPtr ShutDwnUPP;
  64. #endif
  65.  
  66. enum {
  67.     uppShutDwnProcInfo = kRegisterBased
  68.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
  69. };
  70.  
  71. #if GENERATINGCFM
  72. #define NewShutDwnProc(userRoutine)        \
  73.         (ShutDwnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
  74. #else
  75. #define NewShutDwnProc(userRoutine)        \
  76.         ((ShutDwnUPP) (userRoutine))
  77. #endif
  78.  
  79. #if GENERATINGCFM
  80. #define CallShutDwnProc(userRoutine, shutDownStage)        \
  81.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppShutDwnProcInfo, (shutDownStage))
  82. #else
  83. /* (*ShutDwnProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  84. #endif
  85.  
  86. extern pascal void ShutDwnPower(void)
  87.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
  88. extern pascal void ShutDwnStart(void)
  89.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
  90. extern pascal void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
  91.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
  92. extern pascal void ShutDwnRemove(ShutDwnUPP shutDownProc)
  93.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
  94.  
  95. #ifdef __CFM68K__
  96. #pragma lib_export off
  97. #endif
  98.  
  99. #if GENERATINGPOWERPC
  100. #pragma options align=reset
  101. #endif
  102.  
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106.  
  107. #endif /* __SHUTDOWN__ */
  108.